package com.group3.service.mqservice;

import com.group3.common.topic.LiveTopic;
import com.group3.common.topic.NotificationTopic;
import com.group3.model.Order;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RocketMQMessageListener(topic = NotificationTopic.SECKILL_NOTIFICATION, consumerGroup = "notification-group")
public class NotificationMqOrderService implements  RocketMQListener<Order>{
    @Override
    public void onMessage(Order order) {
        log.info("收到用户：{}，的秒杀订单，向用户推送 下单成功消息.order:{}",order.getUid(),order);
    }
}
